beginoutdoorscript;
variables;
short choice;

body;

beginstate INIT_STATE;
break;

beginstate START_STATE;
break;

beginstate 10;
	if (get_flag(0,16) == 0)	{
		message_dialog("The air here is thick and musty, and dust lines the walls.  Ahead you see a few skulls lying here and there.  Just as you are about to turn back from this dead end, you feel a rumbling from below.","This must have been an ancient burial ground or something, because a large number of undead rise up out of the ground, thirsty for blood because of their slumber.  They lurch towards you menacingly.");
		set_flag(0,16,1);
		create_out_spec_enc(0);	}
break;

beginstate 11;
	if (get_flag(0,17) == 0)	{
		message_dialog("As you approach the militia tower, you soon realize something is wrong.  Nobody is at the top of the tower, and you don't see any militia around either.","You do, however, see a few brigands rallying behind you for an ambush.  It appears they had ousted the men in the tower and are now using it as bait for unsuspecting travelers.");
		set_flag(0,17,1);
		create_out_spec_enc(1);	}
break;

beginstate 12;
	message_dialog("At last you beat down the final brigand, and you perform your routine search of corpses.  You find quite a sizable cache of gold inside the boot of one of them.","");
	change_coins(100);
break;

beginstate 13;
	set_out_fight_town_loaded(1);
break;

beginstate 14;
	if (get_flag(0,22) == 0)	{
		reset_dialog();
		add_dialog_str(0,"You find a large group of rainbow-colored caterpillars on these bushes.  If you want, you can collect them up.",0);
		add_dialog_choice(0,"Leave them alone.");
		add_dialog_choice(1,"Take them.");
		choice = run_dialog(1);
		if (choice == 1)
			block_entry(1);
		else	{
			message_dialog("You carefully pick the caterpillars and store them.  Soon after finishing, you see something else move in the bushes.  Unfortunately, this thing is much larger than a caterpillar, but not much unlike one.","");
			change_spec_item(0,1);
			set_flag(0,22,1);
			create_out_spec_enc(2);	}	}
break;

beginstate 15;
	message_dialog("This appears to be a small mine.  You see a few tools lying around, but nothing else of interest.","");
break;

beginstate 16;
	if ((get_highest_skill(16) >= 4) && (get_flag(0,23) == 0))	{
		message_dialog("As you pass through this group of rocks, you notice a small bit of plants near the base of one.  Your knowledge of plant lore tells you that these are healing herbs, a useful ingredient in many potions.","");
		reward_give(214);
		reward_give(214);
		set_flag(0,23,1);	}
break;

beginstate 17;
	if ((get_highest_skill(16) >= 5) && (get_flag(0,24) == 0))	{
		message_dialog("As you pass through this grove of trees, you notice a small bit of plants near a bush.  Your knowledge of plant lore tells you that these are energetic herbs, a useful ingredient in many potions.","");
		reward_give(216);
		reward_give(216);
		set_flag(0,24,1);	}
break;

beginstate 18;
	reset_dialog();
	add_dialog_str(0,"Here is a small prosperous farm which no doubt supplies the town with edibles.  The owner offers to sell you some food, if you'd like.",0);
	add_dialog_choice(0,"Decline his offer.");
	add_dialog_choice(1,"Shop for food.");
	choice = run_dialog(0);
	if (choice == 2)
		begin_shop_mode("Food Supplies","A farmer offers his selection of foods to you for purchase.  It all looks tasty.",5,3,-1);
break;

beginstate 19;
	reset_dialog();
	add_dialog_str(0,"Here is the path over the mountains that surround the area.  Do you wish to leave this scenario?",0);
	add_dialog_choice(0,"No, don't leave.");
	add_dialog_choice(1,"Yes, leave the scenario.");
	choice = run_dialog(0);
	if (choice == 2)
		end_scenario(0);
	else
		block_entry(1);
break;

beginstate 20;
	if (get_flag(0,14) == 0)	{
		message_dialog("What are you doing?  You haven't even asked for directions yet!  Go back and talk to the mayor of the town.","");
		block_entry(1);	}
break;